<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>水平居中</title>
	<style type="text/css">
		body { background-color: #ccc }
		.container { margin: 0 auto; width: 960px; background-color: #ddd; }
		h1 { text-align: center; }
	</style>
</head>
<body>
	<div class="container">
		<h1>这是网站的标题</h1>
	</div>
</body>
</html>